package in.student.confluence.rpc;
 
import javax.xml.rpc.ServiceException;
 
//import localhost.rpc.soap_axis.confluenceservice_v1.ConfluenceSoapService;
//import localhost.rpc.soap_axis.confluenceservice_v1.ConfluenceSoapServiceServiceLocator;

import com.linkedin.corp.iwww.wiki.cf.rpc.soap_axis.confluenceservice_v1.*;
 
import com.atlassian.confluence.rpc.AuthenticationFailedException;
import com.atlassian.confluence.rpc.RemoteException;
import com.atlassian.confluence.rpc.soap.beans.RemotePage;


public class PageReader {
 
  /**
   * Our simple confluence page reader
   *
   * @param args
   * @throws java.rmi.RemoteException
   * @throws RemoteException
   * @throws AuthenticationFailedException
   * @throws ServiceException
   */
  public static void main(String[] args)
    throws AuthenticationFailedException, RemoteException,
    java.rmi.RemoteException, ServiceException {
    final ConfluenceSoapService service;
    ConfluenceSoapServiceServiceLocator serviceLocator = new ConfluenceSoapServiceServiceLocator();
    service = serviceLocator.getConfluenceserviceV1();
 
    // insert your account data here
    String token = service.login("olin", "12matt34!!");
 
    // we are going to fetch a page from the pre-installed Demonstration
    // Space
    //RemotePage page = service.getPage(token, "ds", "Tutorial");
    /*
    RemotePage page = service.getPage(token, "Engineering", "Release Project Planning");
    String renderedOutput = service.renderContent(token, "Engineering",
                                                  page.getId(), page.getContent());
    System.out.println(renderedOutput);
    */

    System.out.println(service.hasUser(token, "olin"));
    System.out.println(service.hasUser(token, "esmaga"));
    System.out.println(service.hasUser(token, "willsmith"));
  }
 
}
